$(function(){
	 $('#login').click(function(){
		 $('#fm').form('submit',{
			 onSubmit: function(){	
		 		return $(this).form('validate');
			 },
			 success:function(data){
				 var json = eval('(' + data + ')');  // change the JSON string to javascript object
				 if(json.errorMsg){
					 $.messager.show({
						 title:'错误',
						 msg:json.errorMsg,
						 timeout:5000,
						 showType:'slide'
						 });
				 } else if (json.url != null) {
					 window.location.href = json.url;
				 }
			}
		 });
		 
		 
	 });
});